1. Field of the Invention
The present invention relates to a method and apparatus for processing an image so as to realize digital halftoning by utilizing an error diffusion method.
2. Description of the Prior Art
Conventionally, in a laser printer or a copying machine, an original halftone image such as a photograph image can be reproduced faithfully by utilizing a dithering method or the error diffusion method that reduces the number of bits.
The error diffusion method is one of digital halftoning expression methods that can reproduce an original halftone image such as a photograph image by reducing the number of bits of the same. In the error diffusion method, a gradation level of an original image is converted into low valued data by using a constant threshold level, and an error between a data value (a density value) of a target pixel and a density value of the low valued data corresponding thereto is distributed to plural peripheral pixels in a predetermined area after being weighted. The error diffusion method can realize a relatively faithful image since a density of an original image can be retained.
In general, an original image is a mixture of a dot image, a character image and a fine line image in addition to a photograph image. In order to reproduce these images of different types or different attributions as faithfully as possible without deteriorating the image quality, it is necessary to process the image appropriately for each area. For example, there is a method of switching the process in accordance with a result of detecting a character area or a photograph area in an image (see U.S. Pat. No. 5,787,195).
If the error diffusion process is performed, a problem is that generation of a dot is delayed at an edge portion. In other words, if input data have 256-step gradation for example, it is supposed that a threshold level is set to “128” for the error diffusion process so as to perform binarization. If there is a black character on a pale background having a color close to white, the data value is very small outside the edge portion of the black character. Therefore, a cumulative value of the error reaches the threshold value very slowly after the output is turned on by the error diffusion process and a dot is made. As a result, the next dot is hardly generated. Thus, even if the edge portion of the black character comes, a dot is not generated promptly, i.e. generation of a dot is delayed.
As a solution to this problem, there is a conventional method in which the threshold value is changed in accordance with a data value of input data. Namely, as represented by a threshold function FJ shown in FIG. 7, the threshold value is decreased if the data value of the input data is small, while it is increased if the data value is large. Thus, a dot can be generated promptly in a pale image.
In that case, however, an edge may become blurring at an edge portion of the black character, and sharpness of the character may be deteriorated. This may be a contributing factor of deterioration of quality of the whole image.